* process.c (Fopen_network_stream): Deal with older systems, which
authorJim Blandy <jimb@redhat.com>
Sat, 22 May 1993 00:12:17 +0000 (00:12 +0000)
committerJim Blandy <jimb@redhat.com>
Sat, 22 May 1993 00:12:17 +0000 (00:12 +0000)
only have the h_addr field in their struct hostent.

src/process.c

index 2b2fc8304dced3a47d494c28be553d6830893e8f..9a1012094dd04c55dcd1ff78e18ab16d606f6aef 100644 (file)
@@ -1448,8 +1448,13 @@ Fourth arg SERVICE is name of the service desired, or an integer\n\
       host_info.h_name = 0;
       host_info.h_aliases = 0;
       host_info.h_addrtype = AF_INET;
-      host_info.h_addr_list  =  &(addr_list[0]);
-      addr_list[0] = (char*)(&numeric_addr);
+#ifdef h_addr
+      /* Older machines have only one address slot called h_addr.
+        Newer machines have h_addr_list, but #define h_addr to
+        be its first element.  */
+      host_info.h_addr_list = &(addr_list[0]);
+#endif
+      host_info.h_addr = (char*)(&numeric_addr);
       addr_list[1] = 0;
       host_info.h_length = strlen (addr_list[0]);
     }